package com.dkd.manage.service.Impl;

import java.util.List;
import com.dkd.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dkd.manage.mapper.WarehouseInventoryMapper;
import com.dkd.manage.domain.WarehouseInventory;
import com.dkd.manage.service.IWarehouseInventoryService;

/**
 * 餐具库存管理Service业务层处理
 * 
 * @author 赵文楠
 * @date 2025-05-19
 */
@Service
public class WarehouseInventoryServiceImpl implements IWarehouseInventoryService 
{
    @Autowired
    private WarehouseInventoryMapper warehouseInventoryMapper;

    /**
     * 查询餐具库存管理
     * 
     * @param id 餐具库存管理主键
     * @return 餐具库存管理
     */
    @Override
    public WarehouseInventory selectWarehouseInventoryById(Long id)
    {
        return warehouseInventoryMapper.selectWarehouseInventoryById(id);
    }

    /**
     * 查询餐具库存管理列表
     * 
     * @param warehouseInventory 餐具库存管理
     * @return 餐具库存管理
     */
    @Override
    public List<WarehouseInventory> selectWarehouseInventoryList(WarehouseInventory warehouseInventory)
    {
        return warehouseInventoryMapper.selectWarehouseInventoryList(warehouseInventory);
    }

    /**
     * 新增餐具库存管理
     * 
     * @param warehouseInventory 餐具库存管理
     * @return 结果
     */
    @Override
    public int insertWarehouseInventory(WarehouseInventory warehouseInventory)
    {
        warehouseInventory.setCreateTime(DateUtils.getNowDate());
        return warehouseInventoryMapper.insertWarehouseInventory(warehouseInventory);
    }

    /**
     * 修改餐具库存管理
     * 
     * @param warehouseInventory 餐具库存管理
     * @return 结果
     */
    @Override
    public int updateWarehouseInventory(WarehouseInventory warehouseInventory)
    {
        warehouseInventory.setUpdateTime(DateUtils.getNowDate());
        return warehouseInventoryMapper.updateWarehouseInventory(warehouseInventory);
    }

    /**
     * 批量删除餐具库存管理
     * 
     * @param ids 需要删除的餐具库存管理主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseInventoryByIds(Long[] ids)
    {
        return warehouseInventoryMapper.deleteWarehouseInventoryByIds(ids);
    }

    /**
     * 删除餐具库存管理信息
     * 
     * @param id 餐具库存管理主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseInventoryById(Long id)
    {
        return warehouseInventoryMapper.deleteWarehouseInventoryById(id);
    }
}
